package com.dunshan.sprin;

/**
 * @author .dunshan
 * @program: dunshan-pef
 * @description: 工厂
 * @date 2021-10-02 10:25:11
 */
public class ObjctFac {





    private Object getBean(String key) {
        Object o = null;
        try {
            Class clazz = Class.forName(key);
            o = clazz.newInstance();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        return o;
    }
}


/**

1 ApplicationContext
 ClassPathXmlApplian
 创建类型
 配置文件的配置 applicationContext.xml
 <bean id=""  class="">

 </bean>


 *
 */
